import { connect } from 'react-redux'
import DebtReceiveHD from '../../../../views/My/MyUtils/DebtManagement/ReceiveHD'

function mapStateToProps(state: any) {
    return {
        userInfo: state.user.userInfo,
        userDebt: state.user.userDebt,
        userDebtReceiveHD: state.user.userDebtReceiveHD,
        userDebtReceiveHDSold: state.user.userDebtReceiveHDSold,
        userDebtReceiveHDAll: state.user.userDebtReceiveHDAll
    }
}

function mapDispatchToProps(dispatch: (obj: any) => void) {
    return {
        'SET_MYUTILS_DEBTREVEIVEHD': (data: any, type: number) => {
            switch (type) {
                case 1: dispatch({ type: 'SET_MYUTILS_DEBTREVEIVEHD', data }); break
                case 2: dispatch({ type: 'SET_MYUTILS_DEBTREVEIVEHDSOLD', data }); break
                default: dispatch({ type: 'SET_MYUTILS_DEBTREVEIVEHDALL', data }); break
            }
        },
    }
}

export default connect(mapStateToProps, mapDispatchToProps)(DebtReceiveHD)